//
// Created by Jisam on 05/10/2024 18:59.
// Solution of  a
#include <bits/stdc++.h>

#define  int long long
#define  endl "\n"
using namespace std;


signed main() {
    cin.tie(nullptr)->sync_with_stdio(false);
    int m, n, t;
    cin >> m >> n >> t;

    vector<int> v(n + 1), c(n + 1);
    for (int i = 0; i < n; i++) {
        cin >> v[i] >> c[i];
    }
    for(int i = 0 ; i <  n ; i  ++)
    {
        for(int j = t; j >= c[i]; i ++)
        {
            if(f[j - c[i]] + v[i] > f[i]){
                f[j] = f[j - c[i]] + v[i];
            }
        }
    }
    int ans = -1;
    for(int j = 0 ;j <= t ; j ++)
    {
        if(f[j] >= m){
            ans =
        }
    }
    if (ans == -1) {
        cout << "NO\n";
    } else {
        cout << "YES\n";
    }

    return 0;
}